<?php
// Copyright 2007 Facebook Corp.  All Rights Reserved. 
// 
// Application: roman_europa
// File: 'index.php' 
//   This is a sample skeleton for your application. 
// 

require_once 'facebook.php';

$appapikey = 'd3d2fd24d09c4efac8857b7acdbcbfec';
$appsecret = '5d322dd2fe267503e7aef106e61db664';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();

// Greet the currently logged-in user!
echo "<p> Hello, <fb:name uid=loggedinuser useyou=false firstnameonly=true />! Mushroom power!</p>";

print_r($user);

// Print out at most 25 of the logged-in user's friends,
// using the friends.get API method
echo "<p>Some of your friends:";
$friends = $facebook->api_client->friends_get();
$friends = array_slice($friends, 0, 25);
foreach ($friends as $friend) {
  echo "<br><fb:name uid=$friend useyou=false  />";
}
echo "</p>";

$connection = mysql_connect("mysql1030.servage.net",
        "europa",
        "omg_L33t");

    mysql_select_db("europa", $connection); 